package me.zhengjie.modules.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.base.BaseEntity;

import javax.persistence.Id;
import javax.validation.constraints.NotNull;

@Data
@TableName("tbl_api")
public class Api extends BaseClass {

    @Id
    @TableId(type = IdType.AUTO, value = "id")
    @NotNull(groups = BaseEntity.Update.class)
    private Long id;

    @ApiModelProperty(value = "api名称")
    @TableField(value = "name")
    private String name;

    @ApiModelProperty(value = "唯一标识")
    @TableField(value = "variable_name")
    private String variableName;

    @ApiModelProperty(value = "api路径")
    @TableField(value = "api_url")
    private String apiUrl;

    @ApiModelProperty(value = "请求方法")
    @TableField(value = "method")
    private String method;

    @ApiModelProperty(value = "执行周期")
    @TableField(value = "cycle")
    private Integer cycle;

    @ApiModelProperty(value = "执行周期")
    @TableField(value = "cycle")
    private boolean keyword;

    @ApiModelProperty(value = "执行周期")
    @TableField(value = "cycle")
    private boolean page;

}
